package com.more.offer.designpatterns.adapter.adapter1;

/**
 * @author pinoc
 * @date 2021/10/27
 * @description
 */
public class SquarePegAdapter extends RoundPeg{

	private SquarePeg squarePeg;

	public SquarePegAdapter() {
	}

	public SquarePegAdapter(SquarePeg squarePeg) {
		this.squarePeg = squarePeg;
	}

	@Override
	public double getRadius() {
		double result;
		result = (Math.sqrt(Math.pow((squarePeg.getWidth() / 2), 2) * 2));
		return result;
	}
}
